<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8"/>
    <title>${session.SOFT_NAME }_智能办公系统</title>
    <meta name="description" content="Dashboard"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <%include("/app/resapi/style.html"){}%>
    <link rel="stylesheet" href="/module/zTree_v3/css/bootstrapStyle/bootstrapStyle.css" type="text/css">
    <link href="/module/jeDate/jedate.css" rel="stylesheet"/>
</head>
<body style="overflow-y: auto;">
<div class="page-body" style="padding: 0px">
    <div class="page-container">
        <div class="col-md-offset-3 col-md-6 col-sm-6 col-xs-12" style="padding: 0px">
            <div class="widget">
                <div class="widget-header bordered-bottom bordered-blue">
                    <span class="widget-caption">任务详情</span>
                </div>
                <div class="widget-body" style="padding-top: 0px">
                    <form class="form-horizontal form-bordered" id="from">
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务标题：</label>
                            <div class="col-sm-5" id="taskName" name="taskName" style="line-height: 34px">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务类型：</label>
                            <div class="col-sm-5" id="taskType" name="taskType" style="line-height: 34px">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">是否置顶 ：</label>
                            <div class="col-sm-5">
                                <div class="control-group" id="isTop" name="isTop" style="line-height: 34px">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">分享人员：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="userPriv" name="userPriv">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">分享部门：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="deptPriv" name="deptPriv">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">分享职务：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="levelPriv" name="levelPriv">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务负责人：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="chargeAccountId" name="chargeAccountId"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务参与人：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="participantAccountId" name="participantAccountId"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务监督人：</label>
                            <div class="col-sm-5" style="line-height: 34px" id="supervisorAccountId" name="supervisorAccountId"></div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务摘要：</label>
                            <div class="col-sm-10" id="remark" style="line-height: 34px">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">任务时间：</label>
                            <div class="col-sm-2" style="line-height: 34px" id="beginTime" readonly="readonly" name="beginTime">
                            </div>
                            <div class="col-sm-3 control-label" style="text-align: left; color: red">注：任务起始时间</div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">所需工期：</label>
                            <div class="col-sm-2" style="line-height: 34px" id="duration" name="duration">
                            </div>
                            <div class="col-sm-3 control-label" style="text-align: left;">天</div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label no-padding-right">${i18n('attach')} ：</label>
                            <div class="col-sm-5">
                                <div style="padding-top: 4px;" id="taskattach">
                                    <div id="show_taskattach"></div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<%include("/app/resapi/sysjs.html"){}%>
<script type="text/javascript">
    var taskId = "${parameter.taskId}";
</script>
<script type="text/javascript" src="/module/fileupload/pageoffice.js" id="po_js_main"></script>
<script type="text/javascript" src="/module/fileupload/fileupload.js"></script>
<script type="text/javascript">
    $(function () {
        getTaskInfo();
    });

    function getTaskInfo() {
        $.ajax({
            url: "/ret/taskget/getTaskById",
            type: "post",
            dataType: "json",
            data: {taskId: taskId},
            success: function (data) {
                if (data.status == "500") {
                    console.log(data.msg);
                } else if (data.status == "100") {
                    layer.msg(data.msg);
                } else {
                    for (var name in data.list) {
                        if (name == "attach") {
                            $("#taskattach").attr("data_value", data.list.attach);
                            createAttach("taskattach", data.list.attachPriv);
                        } else if (name == "userPriv") {
                            $("#" + name).html(getUserNameByStr(data.list.userPriv));
                        } else if (name == "deptPriv") {
                            $("#" + name).html(getDeptNameByDeptIds(data.list.deptPriv));
                        } else if (name == "levelPriv") {
                            $("#" + name).html(getUserLevelStr(data.list.levelPriv));
                        } else if (name == "chargeAccountId") {
                            $("#" + name).html(getUserNameByStr(data.list.chargeAccountId));
                        } else if (name == "participantAccountId") {
                            $("#" + name).html(getUserNameByStr(data.list.participantAccountId));
                        } else if (name == "supervisorAccountId") {
                            $("#" + name).html(getUserNameByStr(data.list.supervisorAccountId));
                        } else if (name == "isTop") {
                            if (data.list.isTop == "0") {
                                $("#" + name).html("顺序");
                            } else if (data.list.isTop == "1") {
                                $("#" + name).html("置顶");
                            }
                        } else if (name == "taskType") {
                            $("#" + name).html(getCodeClassName(data.list.taskType, "task"));
                        } else {
                            $("#" + name).html(data.list[name]);
                        }
                    }
                }
            }
        })
    }
</script>
</html>
